<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
  .tbeven{ background-color: hotpink;}
  .tbodd{  background-color: cornflowerblue;}
  .curpage{background-color: red;}
</style>
</head>
<body>
	<h3>Thymeleaf 标签</h3>	
	<ul th:object="${stu}">
		<li th:text="*{stname}"></li>
		<li th:text="*{password}"></li>
		<li th:text="*{age}"></li>
		<li th:text="*{#dates.format(birthday,'yyyy-MM-dd HH:mm:ss')}"></li>
	</ul>
	<h3> if 标签</h3>	
	如果登录了就可见 ---》<span th:if="${loginuser!=null}" th:text="${stu.stname}">已经登录</span>
	
	<h3>switch</h3>
	<div th:switch="${role}">
		<p th:case="admin">管理 员</p>
		<p th:case="teacher">老师</p>
		<p th:case="*">学生</p>
	</div>
	
	<h3>循环</h3>
	<table border=1 width=300>
	   <tr th:each="st,v : ${heros}" th:class="${v.odd}?'tbodd':'tbeven'">
	      <td th:text="${v.index}"></td>
	      <td th:text="${v.count}"></td>
	   	  <td th:text="${st.stname}"></td>
	   	  <td th:text="${st.password}"></td>
	   	  <td th:text="${st.age}"></td>
	   </tr>
	</table>
	
	<h3>分页页码</h3>
	<div>
		<a href="#" th:each="p,v:${pages}">
		  <span th:text="${p}" th:class="${v.current==cur}?'curpage':''">1</span>
		</a>
	</div>
	
	
	
</body>
</html>